<!DOCTYPE html><html><head><meta charset=utf-8><title>H3DU.SurfaceEval</title></head><body><h1> H3DU.SurfaceEval</h1><p><a href='index.html'>Back to documentation index.</a></p><a name='H3DU.SurfaceEval'></a>
<h3> H3DU.SurfaceEval()</h3><p><b>Deprecated: Use <a href="H3DU.SurfaceBuilder.html">H3DU.SurfaceBuilder</a> instead.</b></p>An evaluator of parametric functions for generating
vertex attributes of a surface.<p>
See the <a href="tutorial-surfaces.html">Parametric Curves and Parametric Surfaces</a> tutorial for more information.<h4> Parameters</h4><ul></ul><h3> Methods</h3><ul><li><a href='#H3DU.SurfaceEval_color'>color</a><br>Specifies a parametric surface function for generating color values.<li><a href='#H3DU.SurfaceEval_evalOne'>evalOne</a><br>Generates vertex positions and attributes based on a point
in a parametric surface.<li><a href='#H3DU.SurfaceEval_evalSurface'>evalSurface</a><br>Generates the vertex positions and attributes of a parametric
surface.<li><a href='#H3DU.SurfaceEval_normal'>normal</a><br>Specifies a parametric surface function for generating normals.<li><a href='#H3DU.SurfaceEval_setAutoNormal'>setAutoNormal</a><br>Sets whether this object will automatically generate
normals rather than use the parametric evaluator
specified for normal generation, if any.<li><a href='#H3DU.SurfaceEval_texCoord'>texCoord</a><br>Specifies a parametric surface function for generating texture coordinates.<li><a href='#H3DU.SurfaceEval_vertex'>vertex</a><br>Specifies a surface evaluator object for generating the vertex positions of a parametric surface.</ul><a name='H3DU.SurfaceEval_color'></a>
<h3> H3DU.SurfaceEval#color(evaluator)</h3>Specifies a parametric surface function for generating color values.<h4> Parameters</h4><ul><li><code>evaluator</code> (Type: Object)<br>An object that must contain a method named <code>evaluate</code> that takes a U coordinate and a V coordinate and returns a 3-element array.</ul><h4> Return Value</h4>This object. (Type: <a href="H3DU.SurfaceEval.html">H3DU.SurfaceEval</a>)<a name='H3DU.SurfaceEval_evalOne'></a>
<h3> H3DU.SurfaceEval#evalOne(mesh, u, v)</h3>Generates vertex positions and attributes based on a point
in a parametric surface.<h4> Parameters</h4><ul><li><code>mesh</code> (Type: <a href="H3DU.Mesh.html">H3DU.Mesh</a>)<br>H3DU.Mesh where vertex positions and attributes will be generated. When this method returns, the current color, normal, and texture coordinates will be the same as they were before the method started.<li><code>u</code> (Type: number)<br>U coordinate of the surface to evaluate.<li><code>v</code> (Type: number)<br>V coordinate of the surface to evaluate.</ul><h4> Return Value</h4>This object. (Type: <a href="H3DU.SurfaceEval.html">H3DU.SurfaceEval</a>)<a name='H3DU.SurfaceEval_evalSurface'></a>
<h3> H3DU.SurfaceEval#evalSurface(mesh, [mode], [un], [vn], [u1], [u2], [v1], [v2])</h3>Generates the vertex positions and attributes of a parametric
surface.<h4> Parameters</h4><ul><li><code>mesh</code> (Type: <a href="H3DU.Mesh.html">H3DU.Mesh</a>)<br>The mesh where vertex positions and attributes will be generated. When this method returns, the current color, normal, and texture coordinates will be the same as they were before the method started.<li><code>mode</code> (Type: number) (optional)<br>If this value is <a href="H3DU.Mesh.html#H3DU.Mesh.TRIANGLES">H3DU.Mesh.TRIANGLES</a>, or is null, undefined, or omitted, generates a series of triangles defining the surface. If this value is <a href="H3DU.Mesh.html#H3DU.Mesh.LINES">H3DU.Mesh.LINES</a>, generates a series of lines defining the surface. If this value is <a href="H3DU.Mesh.html#H3DU.Mesh.POINTS">H3DU.Mesh.POINTS</a>, generates a series of points along the surface. For any other value, this method has no effect.<li><code>un</code> (Type: number) (optional)<br>Number of subdivisions along the U axis. Default is 24.<li><code>vn</code> (Type: number) (optional)<br>Number of subdivisions along the V axis. Default is 24.<li><code>u1</code> (Type: number) (optional)<br>Starting U coordinate of the surface to evaluate. Default is the starting U coordinate given by the <a href="H3DU.SurfaceEval.html#H3DU.SurfaceEval_vertex">surface evaluator object</a>, or 0 if not given.<li><code>u2</code> (Type: number) (optional)<br>Ending U coordinate of the surface to evaluate. Default is the ending U coordinate given by the <a href="H3DU.SurfaceEval.html#H3DU.SurfaceEval_vertex">surface evaluator object</a>, or 1 if not given.<li><code>v1</code> (Type: number) (optional)<br>Starting V coordinate of the surface to evaluate. Default is the starting V coordinate given by the <a href="H3DU.SurfaceEval.html#H3DU.SurfaceEval_vertex">surface evaluator object</a>, or 0 if not given.<li><code>v2</code> (Type: number) (optional)<br>Ending V coordinate of the surface to evaluate. Default is the ending V coordinate given by the <a href="H3DU.SurfaceEval.html#H3DU.SurfaceEval_vertex">surface evaluator object</a>, or 1 if not given.</ul><h4> Return Value</h4>This object. (Type: <a href="H3DU.SurfaceEval.html">H3DU.SurfaceEval</a>)<a name='H3DU.SurfaceEval_normal'></a>
<h3> H3DU.SurfaceEval#normal(evaluator)</h3>Specifies a parametric surface function for generating normals.<h4> Parameters</h4><ul><li><code>evaluator</code> (Type: Object)<br>An object that must contain a method named <code>evaluate</code> that takes a U coordinate and a V coordinate and returns a 3-element array.</ul><h4> Return Value</h4>This object. (Type: <a href="H3DU.SurfaceEval.html">H3DU.SurfaceEval</a>)<a name='H3DU.SurfaceEval_setAutoNormal'></a>
<h3> H3DU.SurfaceEval#setAutoNormal(value)</h3>Sets whether this object will automatically generate
normals rather than use the parametric evaluator
specified for normal generation, if any.
By default, normals won't be generated automatically.<h4> Parameters</h4><ul><li><code>value</code> (Type: Boolean)<br>Either true or false. True means normals will automatically be generated; false means they won't.</ul><h4> Return Value</h4>This object. (Type: <a href="H3DU.SurfaceEval.html">H3DU.SurfaceEval</a>)<a name='H3DU.SurfaceEval_texCoord'></a>
<h3> H3DU.SurfaceEval#texCoord(evaluator)</h3>Specifies a parametric surface function for generating texture coordinates.<h4> Parameters</h4><ul><li><code>evaluator</code> (Type: Object)<br>An object that must contain a method named <code>evaluate</code> that takes a U coordinate and a V coordinate and returns a 2-element array.</ul><h4> Return Value</h4>This object. (Type: <a href="H3DU.SurfaceEval.html">H3DU.SurfaceEval</a>)<a name='H3DU.SurfaceEval_vertex'></a>
<h3> H3DU.SurfaceEval#vertex(evaluator)</h3>Specifies a surface evaluator object for generating the vertex positions of a parametric surface.<h4> Parameters</h4><ul><li><code>evaluator</code> (Type: <a href="H3DU.Surface.html">H3DU.Surface</a> | Object)<br>An object described in <a href="H3DU.Surface.html">H3DU.Surface</a>. Can be null, in which case, disables generating vertex positions.</ul><h4> Return Value</h4>This object. (Type: <a href="H3DU.SurfaceEval.html">H3DU.SurfaceEval</a>)<p><a href='index.html'>Back to documentation index.</a></p></body></html>
